package com.api.day01stringdemo1;

import java.util.StringJoiner;

public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder ab = new StringBuilder();
        StringBuilder sb = new StringBuilder("abc");
        //增加
        ab.append("abc");
        String s = sb.toString();
        System.out.println(ab);
        System.out.println(s);
        //替换
        sb.replace(0,10,"学Java，改变世界");
        //删除
        sb.delete(0,6);
        //插入
        sb.insert(0,"学Java，");

        System.out.println(sb);
    }
}
